﻿using System;
using System.Collections.Generic;
using System.Text;

namespace MQTT.Share.Helper
{
    public class DateHelper
    {

        /// <summary>
        /// 给定一个日期 获取当天的时间段
        /// </summary>
        /// <param name="date"></param>
        /// <returns></returns>
        public static List<DateTime> GetDateTimesByDate(DateTime date)
        {
            DateTime date1 = new DateTime(date.Year, date.Month, date.Day);
            DateTime date2 = new DateTime(date.Year, date.Month, date.Day, 23, 59, 59);
            return new List<DateTime>()
            {
                date1,
                date2
            };
        }
    }
}
